define(['app'], function(app) {
    'use strict';

    //实例化方法
    var factory = function (Http) {
		
        //返回信息
        return {
            //商品详情
            product_detail: function(goods_id, act_id,product_id,method,callback) {
				Http.post({
					method: method,
					goods_id: goods_id,
					act_id:act_id,
					product_id:product_id
				}, function(result) {
					if(callback)
						callback(result);
				}, function(e) {

				}, function() {

				});
			},
			//限时拍卖专用，每隔10s请求一次
            auction_detail: function(goods_id, act_id,product_id,callback) {
				Http.postHide({
					method: "marketing.auction.view",
					goods_id: goods_id,
					act_id:act_id,
					product_id:product_id
				}, function(result) {
					if(callback)
						callback(result);
				}, function(e) {

				}, function() {

				});
			},
			//购买
			buy:function(goods_id,products_id,num,act_id,method,callback){
				Http.post({
					method:method,
					goods_id:goods_id,
					product_id:products_id,
					num:num,
					act_id:act_id
				},function(result){
					if(callback)
					callback(result);
				})
			},
			//提交出价
			auction_apply: function(act_id, price, callback) {
				Http.post({
					method: 'marketing.auction.apply',
					act_id: act_id,
					price: price
				}, function(result) {
					if(callback)
						callback(result);
				})
			},
			//保证金规则里的文章
			get_article:function(id,callback){
				Http.post({
					method:'marketing.auction.get_article',
					id:id
				},function(result){
					if(callback)
						callback(result);
				})
			},
			//客服列表
			//客服QQ与联系方式
			contact_show: function(store_id,callback) {
				Http.post({
					method: 'shop.cusphone.getlist',
					store_id:store_id
				}, function(result) {
					//函数回调
					if(callback)
						callback(result.result);
				}, function(e) {

				}, function() {

				});
			}
			
            
        };
    }

    factory.$inject = ['Http'];
    return app.registerService("Activitythree", factory);
});